#include <stdio.h>
#include <unistd.h>
#include <pthread.h>

class MyThread
{
    public:
        MyThread()
        {

        }
        ~MyThread()
        {

        }
        int Start()
        {
            int ret = pthread_create(&tid_,NULL,MyThreadStart,(void*)this);
            if(ret < 0)
            {
                return -1;
            }
            return 0;
        }
        static void* MyThreadStart(void* arg)
        {          
            MyThread* mt = (MyThread*)arg;
           printf("%p\n",mt->tid_);//两者的类型不一样会出现警告
           //%p打印出来的是一个地址，类型是一个整型，而tid_t是类型是pthread_t
        }
    private:
        pthread_t tid_;
};
int main()
{
    return 0;
}
